package com.olap.starter.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.olap.starter.core.base.BaseService;
import com.olap.starter.mapper.TableDeleteMapper;
import com.olap.starter.pojo.TableConfig;
import com.olap.starter.pojo.TableDelete;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author WBG
 * @since 2022-12-01
 */
@Service
@DS("online")
public class TableDeleteServices extends BaseService<TableDeleteMapper, TableDelete> {

    public void saveList(TableDelete tableDelete, TableConfig tableConfig) {
        if(tableDelete == null){
            return;
        }
        tableDelete.setId(null);
        tableDelete.setParentId(tableConfig.getId());
        tableDelete.setTheme(tableConfig.getTheme());
        save(tableDelete);
    }

    @Override
    public TableDelete getOne(Wrapper<TableDelete> queryWrapper) {
        return super.getOne(queryWrapper);
    }
}
